package com.project.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.daos.AdminMemberMapper;
import com.project.entity.Member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class AdminMemberService {

    @Autowired
    private AdminMemberMapper adminMemberMapper;

    public PageInfo<Member> selAllMember(String keyWord,Integer currentPage,Integer pageSize){
        PageHelper.startPage(currentPage,pageSize);
        List<Member> members = adminMemberMapper.selAllMember(keyWord);
        PageInfo<Member> memberPageInfo = new PageInfo<>(members);
        return memberPageInfo;
    }
}
